
<div class="form">
    <?php
    $path = Yii::app()->request->baseUrl . '/';
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'article-form',
        'enableAjaxValidation' => false,
        /* 'enableClientValidation' => true,
          'clientOptions' => array(
          'validateOnSubmit' => true,
          ), */
        'htmlOptions' => array('enctype' => 'multipart/form-data', 'accept-charset' => 'UTF-8'), //, 'accept-charset' => 'UTF-8'
    ));
    ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php
    echo $form->errorSummary($article);
    ?>

    <div class="row">
        <?php echo $form->labelEx($article, 'Category' . ' (*)'); ?>
        <?php
        echo $form->dropDownList($article, 'category_id', CHtml::listData($categories, 'id', 'name_en')); //, array('prompt' => 'Chọn loại danh mục')
        ?>
        <?php echo $form->error($article, 'category_id'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($article, 'Member'); ?>
        <?php echo $form->textField($article, 'member_id', array('size' => 10, 'maxlength' => 10, 'title' => 'Member')); ?>
        <?php echo $form->error($article, 'member_id'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($article, 'Title (*)') ?>
        <?php echo $form->textField($article, "title", array('size' => 60, 'title' => 'Title of article')) ?>
        <?php echo $form->error($article, "title"); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($article, 'Key word (*)') ?>
        <?php echo $form->textField($article, "keyword", array('size' => 60, 'title' => 'Key word of article in url')) ?>
        <?php echo $form->error($article, "keyword"); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($article, 'Content (*)') ?>
        <?php
        $this->widget('application.extensions.eckeditor.ECKEditor', array(
            'model' => $article,
            'attribute' => "content",
            'config' => array(
                'toolbar' => 'Full',
            ),
        ));
        ?>
        <?php echo $form->error($article, 'content'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($article, 'Quote from (*)') ?>
        <?php echo $form->textField($article, "quotefrom", array('size' => 60, 'title' => 'Quote from ')) ?>
        <?php echo $form->error($article, "quotefrom"); ?>
    </div>

    <div class="row buttons">
        <?php
        echo CHtml::submitButton($article->isNewRecord ? Yii::t('article', 'create') : Yii::t('article', 'save'), array('width' => 20));
        ?>
    </div>
    <?php $this->endWidget(); ?>
    <h2><b><div id="message"></div> </b></h2>
</div><!-- form -->